﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Draco.OWF.RT;
using Draco.OWF.DataBinding;

namespace Draco.OWF
{
    public interface IProcess
    {
        String Id { get; set; }
        String Name { get; set; }
        String DisplayName { get; set; }
        String Description { get; set; }
        String Creator { get; set; }
        DateTime CreateDate { get; set; }
        String Version { get; set; }

        bool Readonly { get; set; }
        IActivity StartActivity { get; }
        IActivity EndActivity { get; }
        List<IActivity> Activities { get; }
        List<IRoute> Routes { get; }

        IActivity GetActivity(String activityId);
        IRoute GetRoute(String routeId);
        IRoute GetRoute(String fromAcId,String toAcId);
        List<IActivity> GetNextActivities(String activityId);
        List<IActivity> GetPreviousActivities(String activityId);

        List<IRoute> GetFromActivityRoutes(String activityId);
        List<IRoute> GetToActivityRoutes(String activityId);

        void AddActivity(IActivity activity);
        void AddRoute(IRoute route);
        void RemoveActivity(String activityId);
        void RemoveRoute(String routeId);
        void Clear();
        bool Check();

        bool EnsureStartActivity();

        IJob CreateProcessInstance(IBindingDataItemCollection startParameters);
    }
}
